//
//  PackageSKUCell.m
//  BaseProject
//
//  Created by 王洋 on 2021/5/14.
//  Copyright © 2021 王洋. All rights reserved.
//

#import "PackageSKUCell.h"

@implementation PackageSKUCell

- (void)awakeFromNib {
    [super awakeFromNib];

    self.layer.cornerRadius = 13.0;
    self.layer.borderWidth = 1;

}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.layer.cornerRadius = 13.0;
    self.layer.borderWidth = 1;
}

- (void)fillCellWithModel:(CommonSkuModel *)model {
    
    self.skuNameLab.text = model.specName;
    
    if (model.isSelect) {
        self.skuNameLab.textColor = UIColorHex(0xF78E2E);
        self.backgroundColor = UIColorHex(0xfff6f0);
        self.layer.borderColor = UIColorHex(0xF78E2E).CGColor;
    } else {
        self.skuNameLab.textColor = UIColorHex(0x222222);
        self.backgroundColor = UIColorHex(0xF5F5F5);
        self.layer.borderColor = UIColorHex(0xf1f1f1).CGColor;
    }
    
}

- (void)setCellType:(PackageSKUSelType)selType {

    switch (selType) {
        case PackageSKUSelType_sel:{
            
            self.skuNameLab.textColor = UIColorHex(0xF78E2E);
            self.layer.borderColor = UIColorHex(0xF78E2E).CGColor;
            self.backgroundColor = UIColorHex(0xfff6f0);

        } break;
        case PackageSKUSelType_nor:{
            
            self.skuNameLab.textColor = UIColorHex(0x222222);
            self.layer.borderColor = UIColorHex(0xf1f1f1).CGColor;
            self.backgroundColor = UIColorHex(0xF5F5F5);

        } break;
        case PackageSKUSelType_stop:{
            
            self.skuNameLab.textColor = UIColorHex(0xcccccc);
            self.layer.borderColor = UIColorHex(0xf7f7f7).CGColor;
            self.backgroundColor = UIColorHex(0xF7F7F7);

        } break;
        default:
            break;
    }
    
    

    
}

@end
